package com.clps.dev.sms.dao.sm;

import java.io.Serializable;
import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import com.clps.dev.sms.entity.sm.Department;

/**  
* @ClassName: DepartmentDao  
* @Description: DepartmentDao  
* @since JDK 1.8 
* @author RuiShan.Yang  
* @date 2018-11-28 12:39:14  
* 
*/
public interface DepartmentDao {

	/**  
	* @Title: save  
	* @Description: 保存一个部门
	* @param department
	* @return String
	* @throws  
	*/
	public String save(Department department);

	/**  
	* @Title: deleteById  
	* @Description: 通过部门ID 删除一个部门
	* @param departmentId
	* @return String
	* @throws  
	*/
	public String deleteById(Serializable departmentId);

	/**  
	* @Title: update  
	* @Description: 更新部门信息
	* @param department
	* @param departmentId
	* @return String
	* @throws  
	*/
	public String update(Department department, Serializable departmentId);

	/**  
	* @Title: queryById  
	* @Description: 通过部门ID 查找
	* @param departmentId
	* @return Department
	* @throws  
	*/
	public Department queryById(Serializable departmentId);

	/**  
	* @Title: queryALl  
	* @Description: 查找所有部门
	* @return List<Department>
	* @throws  
	*/
	public List<Department> queryALl();

	/**  
	* @Title: findCount  
	* @Description: 统计部门数量
	* @param detachedCriteria
	* @return Integer
	* @throws  
	*/
	public Integer findCount(DetachedCriteria detachedCriteria);

	/**  
	* @Title: findByPage  
	* @Description: 分页查询
	* @param detachedCriteria
	* @param begin
	* @param pageSize
	* @return List<Department>
	* @throws  
	*/
	public List<Department> findByPage(DetachedCriteria detachedCriteria, Integer begin, Integer pageSize);

	/**  
	* @Title: queryBySql  
	* @Description: 通过SQL语句查询
	* @param sql
	* @return List<Department>
	* @throws  
	*/
	public List<Department> queryBySql(String sql);

	/**  
	* @Title: queryByDepartmentLikeName  
	* @Description: 通过部门名称模糊查询
	* @param departmentName
	* @return List<Department>
	* @throws  
	*/
	public List<Department> queryByDepartmentLikeName(String departmentName);

	/**  
	* @Title: findByPageOrderByName  
	* @Description: 根据部门名称排序 
	* @param detachedCriteria
	* @param begin
	* @param pageSize
	* @param name
	* @return List<Department>
	* @throws  
	*/
	public List<Department> findDepartmentByPageOrderByName(DetachedCriteria detachedCriteria, Integer begin, Integer pageSize,
			String departmentName);

	/**  
	* @Title: findByPageOrderByTime  
	* @Description: 根据创建时间排序
	* @param detachedCriteria
	* @param begin
	* @param pageSize
	* @param time
	* @return List<Department>
	* @throws  
	*/
	public List<Department> findDepartmentByPageOrderByTime(DetachedCriteria detachedCriteria, Integer begin, Integer pageSize,
			String departmentCreatedTime);

	/**  
	* @Title: queryByField  
	* @Description: 根据部门字段值查询
	* @param departmentFieldName
	* @param departmentFieldVal
	* @return List<Department>
	* @throws  
	*/
	public List<Department> queryByField(String departmentFieldName, String departmentFieldVal);

}
